chore: fix CI, harden security, rewrite README; hermetic test fixture#2
Merged
Merged
Conversation
The prior "feat: add CI" commit shipped workflows that never ran and were
internally contradictory. This makes CI functional and hermetic, hardens the
security posture, and corrects the documentation.
CI / QA (.github/workflows/ci.yml):
- Trigger on master (was `main` → default branch is master → CI never ran).
- Vendor the docs-example dist as tests/fixtures/docs-example.dist.tar.gz and
point apps.json + setup-test-apps.mjs at it, so build + E2E are fully hermetic
(no GITHUB_TOKEN, network, or sibling repo). Resolves the apps.json (local
prebuilt) vs CI (GitHub fetch) contradiction.
- Run the real web-fragment harness (npm test) plus a fixed standalone layer.
- Point playwright.config.ci.js at tests/fragment-server.mjs (nginx-mirror)
instead of `astro preview`, whose configurePreviewServer rewrite never runs
for static output (the /__wf asset route would 404).
- Add least-privilege permissions, SHA-pin all actions, add an npm audit gate.
- typecheck (astro check) is non-blocking — it OOMs on standard runners; the
build job is the hard compile gate.
- exclude standalone.spec.js from the embedded config (wrong baseURL otherwise);
fix stale `example` slug → user-guide and the false astro-preview claims;
make the URL-update test wait on waitForURL (was a networkidle flake).
Security:
- .github/dependabot.yml (npm + github-actions, weekly).
- SECURITY.md, .dockerignore (shrinks build context, avoids leaking source).
- LICENSE (Apache-2.0), CONTRIBUTING.md.
validate-doc-app.yml:
- Fix the ESM heredocs (node --input-type=module) and install ajv transiently —
they previously ran as CommonJS and threw on `import`.
- Schema URL main → master; SHA-pin actions; add permissions.
- De-ABSA the token check (--color-kb-500) and fix the /apps/ → /knowledge-base/
mount-path message.
Docs / app:
- Rewrite README to match reality: Node 24, correct /knowledge-base/{slug}/ mount
path, real scripts + project tree, the test harness + both Playwright configs,
generalized web-fragment embedding (the included host server as reference),
pinned action SHAs, @master.
- Base.astro: add data-astro-transition-persist to the font link (mirrors
transform.js) to reduce #297 head accumulation on the landing page.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the merged web-fragment test suite. The prior
feat: add CIcommit shipped workflows that never ran (triggered onmain; default branch ismaster) and were internally contradictory. This makes CI functional + hermetic, hardens security, and corrects the docs. All changes verified locally (embedded 21/21, standalone 14/14, build hermetic, audit clean).🔴 QA / CI —
ci.ymlmaster(wasmain→ CI never ran, incl. on PR test: self-contained web-fragment E2E suite #1).tests/fixtures/docs-example.dist.tar.gz;apps.json+setup-test-apps.mjspoint at it → noGITHUB_TOKEN, network, or sibling repo. Resolves theapps.json(local prebuilt) vs CI (GitHub fetch) contradiction.npm test) + a fixed standalone layer.playwright.config.ci.js→tests/fragment-server.mjs(nginx-mirror) instead ofastro preview, whoseconfigurePreviewServerrewrite never runs for static output (the/__wfasset route 404'd → the standalone asset test could never pass).standalone.spec.jsfrom the embedded config (wrong baseURL otherwise); fix staleexampleslug →user-guide;url-updatetest now waits onwaitForURL(was anetworkidleflake).typecheck(astro check) is non-blocking — it OOMs on standard runners (pre-existing); thebuildjob is the hard compile gate.🟠 Security
permissions: contents: readon both workflows; all actions SHA-pinned;npm auditgate (currently 0 prod vulns)..github/dependabot.yml(npm + github-actions);SECURITY.md;.dockerignore(shrinks build context, avoids leaking source/secrets into the image).LICENSE(Apache-2.0),CONTRIBUTING.md.🟠
validate-doc-app.yml(was fully broken)node --input-type=module) + installajvtransiently — they ran as CommonJS and threw onimport.main→master; SHA-pin actions; addpermissions.--color-kb-500); fix the/apps/→/knowledge-base/mount-path message.🟡 Docs / app
/knowledge-base/{slug}/mount path, real scripts + project tree, the test harness + both Playwright configs, generalized web-fragment embedding (the includedtests/host/server.mjsas a reference host), pinned action SHAs,@master.Base.astro: adddata-astro-transition-persistto the font link (mirrorstransform.js) to reduce #297 head accumulation on the landing page.Verify locally
🤖 Generated with Claude Code